.class public Lrexsee/core/browser/RexseeClient;
.super Ljava/lang/Object;
.source "RexseeClient.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lrexsee/core/browser/RexseeClient$ClientDescription;
    }
.end annotation


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "Client"

.field public static final PREFERENCE_NAME:Ljava/lang/String; = "client"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;

.field private syncClientDescription:Lrexsee/core/browser/RexseeClient$ClientDescription;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 71
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 68
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/core/browser/RexseeClient;->syncClientDescription:Lrexsee/core/browser/RexseeClient$ClientDescription;

    .line 72
    iput-object p1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    .line 73
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/core/browser/RexseeClient;->mContext:Landroid/content/Context;

    .line 74
    return-void
.end method

.method static synthetic access$0(Lrexsee/core/browser/RexseeClient;Lrexsee/core/browser/RexseeClient$ClientDescription;)V
    .locals 0

    .prologue
    .line 68
    iput-object p1, p0, Lrexsee/core/browser/RexseeClient;->syncClientDescription:Lrexsee/core/browser/RexseeClient$ClientDescription;

    return-void
.end method

.method static synthetic access$1(Lrexsee/core/browser/RexseeClient;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 67
    iget-object v0, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$2(Lrexsee/core/browser/RexseeClient;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    .prologue
    .line 81
    invoke-direct {p0, p1}, Lrexsee/core/browser/RexseeClient;->removeLeadingDotAndSlash(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private getClient_(Ljava/lang/String;ZZ)Lrexsee/core/browser/RexseeClient$ClientDescription;
    .locals 9
    .param p1, "xml"    # Ljava/lang/String;
    .param p2, "showProgress"    # Z
    .param p3, "cancelable"    # Z

    .prologue
    .line 199
    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->interfaceList:Lrexsee/core/browser/clazz/JavascriptInterfaceList;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "Ajax"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lrexsee/core/browser/clazz/JavascriptInterfaceList;->get(Ljava/lang/String;)Lrexsee/core/browser/clazz/JavascriptInterface;

    move-result-object v0

    check-cast v0, Lrexsee/core/transportation/RexseeAjax;

    .line 200
    .local v0, "ajax":Lrexsee/core/transportation/RexseeAjax;
    if-nez v0, :cond_0

    .line 201
    new-instance v7, Lrexsee/core/browser/RexseeClient$ClientDescription;

    invoke-direct {v7, p0}, Lrexsee/core/browser/RexseeClient$ClientDescription;-><init>(Lrexsee/core/browser/RexseeClient;)V

    .line 202
    .local v7, "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    const-string v1, "Ajax object is not available."

    iput-object v1, v7, Lrexsee/core/browser/RexseeClient$ClientDescription;->error:Ljava/lang/String;

    move-object v8, v7

    .line 212
    .end local v7    # "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    .local v8, "client":Ljava/lang/Object;
    :goto_0
    return-object v8

    .line 205
    .end local v8    # "client":Ljava/lang/Object;
    :cond_0
    const-string v2, ""

    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    invoke-virtual {v1}, Lrexsee/core/application/RexseeApplication;->getDefaultEncoding()Ljava/lang/String;

    move-result-object v3

    move-object v1, p1

    move v4, p2

    move v5, p3

    invoke-virtual/range {v0 .. v5}, Lrexsee/core/transportation/RexseeAjax;->syncSubmit(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/lang/String;

    move-result-object v6

    .line 206
    .local v6, "ajaxRtn":Ljava/lang/String;
    const-string v1, "[Exception]"

    invoke-virtual {v6, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 207
    new-instance v7, Lrexsee/core/browser/RexseeClient$ClientDescription;

    invoke-direct {v7, p0}, Lrexsee/core/browser/RexseeClient$ClientDescription;-><init>(Lrexsee/core/browser/RexseeClient;)V

    .line 208
    .restart local v7    # "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    iput-object v6, v7, Lrexsee/core/browser/RexseeClient$ClientDescription;->error:Ljava/lang/String;

    :goto_1
    move-object v8, v7

    .line 212
    .restart local v8    # "client":Ljava/lang/Object;
    goto :goto_0

    .line 210
    .end local v7    # "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    .end local v8    # "client":Ljava/lang/Object;
    :cond_1
    invoke-direct {p0, p1, v6, p2}, Lrexsee/core/browser/RexseeClient;->parseXML_(Ljava/lang/String;Ljava/lang/String;Z)Lrexsee/core/browser/RexseeClient$ClientDescription;

    move-result-object v7

    .restart local v7    # "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    goto :goto_1
.end method

.method private getVersionKey(Ljava/lang/String;)Ljava/lang/String;
    .locals 3
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    const-string v2, "?"

    .line 77
    iget-object v0, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->urlListeners:Lrexsee/core/browser/RexseeUrl;

    invoke-virtual {v0, p1}, Lrexsee/core/browser/RexseeUrl;->getAbsoluteUrl(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    .line 78
    const-string v0, "?"

    invoke-virtual {p1, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    const-string v1, "?"

    invoke-virtual {p1, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {p1, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    .line 79
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "client_"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const/4 v1, 0x1

    invoke-static {p1, v1}, Lrexsee/core/utilities/Utilities;->md5(Ljava/lang/String;Z)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private parseXML_(Ljava/lang/String;Ljava/lang/String;Z)Lrexsee/core/browser/RexseeClient$ClientDescription;
    .locals 3
    .param p1, "xml"    # Ljava/lang/String;
    .param p2, "code"    # Ljava/lang/String;
    .param p3, "showProgress"    # Z

    .prologue
    .line 91
    if-eqz p3, :cond_0

    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    sget-object v2, Lrexsee/core/lang/RexseeLanguage;->PROGRESS_ONGOING:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lrexsee/core/progress/RexseeProgressDialog;->show(Ljava/lang/String;)V

    .line 92
    :cond_0
    new-instance v0, Lrexsee/core/browser/RexseeClient$1;

    invoke-direct {v0, p0, p2, p1}, Lrexsee/core/browser/RexseeClient$1;-><init>(Lrexsee/core/browser/RexseeClient;Ljava/lang/String;Ljava/lang/String;)V

    .line 184
    .local v0, "parseThread":Ljava/lang/Thread;
    const/4 v1, 0x0

    iput-object v1, p0, Lrexsee/core/browser/RexseeClient;->syncClientDescription:Lrexsee/core/browser/RexseeClient$ClientDescription;

    .line 185
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 186
    :goto_0
    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->syncClientDescription:Lrexsee/core/browser/RexseeClient$ClientDescription;

    if-eqz v1, :cond_2

    .line 192
    const/4 v0, 0x0

    .line 193
    if-eqz p3, :cond_1

    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    invoke-virtual {v1}, Lrexsee/core/progress/RexseeProgressDialog;->hide()V

    .line 194
    :cond_1
    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->syncClientDescription:Lrexsee/core/browser/RexseeClient$ClientDescription;

    return-object v1

    .line 188
    :cond_2
    const-wide/16 v1, 0x64

    :try_start_0
    invoke-static {v1, v2}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 189
    :catch_0
    move-exception v1

    goto :goto_0
.end method

.method private removeLeadingDotAndSlash(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .param p1, "str"    # Ljava/lang/String;

    .prologue
    const/4 v1, 0x1

    .line 82
    if-nez p1, :cond_2

    const/4 v0, 0x0

    .line 87
    :goto_0
    return-object v0

    .line 84
    :cond_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v0

    if-gt v0, v1, :cond_1

    const-string v0, ""

    goto :goto_0

    .line 85
    :cond_1
    invoke-virtual {p1, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p1

    .line 83
    :cond_2
    const-string v0, "."

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "/"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    move-object v0, p1

    .line 87
    goto :goto_0
.end method


# virtual methods
.method public build(Ljava/lang/String;)Ljava/lang/String;
    .locals 9
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    const/4 v8, 0x1

    .line 248
    invoke-direct {p0, p1, v8, v8}, Lrexsee/core/browser/RexseeClient;->getClient_(Ljava/lang/String;ZZ)Lrexsee/core/browser/RexseeClient$ClientDescription;

    move-result-object v0

    .line 249
    .local v0, "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    iget-object v5, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->error:Ljava/lang/String;

    if-eqz v5, :cond_0

    .line 250
    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "[Exception]"

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v6, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->error:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    .line 261
    :goto_0
    return-object v5

    .line 252
    :cond_0
    iget-object v5, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v5, v5, Lrexsee/core/browser/Browser;->interfaceList:Lrexsee/core/browser/clazz/JavascriptInterfaceList;

    new-instance v6, Ljava/lang/StringBuilder;

    iget-object v7, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v7, v7, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v7, v7, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v7, v7, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v7, "Download"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Lrexsee/core/browser/clazz/JavascriptInterfaceList;->get(Ljava/lang/String;)Lrexsee/core/browser/clazz/JavascriptInterface;

    move-result-object v2

    check-cast v2, Lrexsee/core/transportation/RexseeDownload;

    .line 253
    .local v2, "downloader":Lrexsee/core/transportation/RexseeDownload;
    if-nez v2, :cond_1

    const-string v5, "[Exception]Download object is not available."

    goto :goto_0

    .line 254
    :cond_1
    iget-object v5, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->files:Ljava/util/ArrayList;

    invoke-virtual {v2, v5, v8}, Lrexsee/core/transportation/RexseeDownload;->syncDownload(Ljava/util/ArrayList;Z)Ljava/lang/String;

    move-result-object v1

    .line 255
    .local v1, "download":Ljava/lang/String;
    const-string v5, ""

    invoke-virtual {v1, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_2

    .line 256
    iget-object v5, p0, Lrexsee/core/browser/RexseeClient;->mContext:Landroid/content/Context;

    const-string v6, "client"

    const/4 v7, 0x0

    invoke-virtual {v5, v6, v7}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 257
    .local v4, "preference":Landroid/content/SharedPreferences;
    invoke-interface {v4}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v3

    .line 258
    .local v3, "editor":Landroid/content/SharedPreferences$Editor;
    iget-object v5, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->xml:Ljava/lang/String;

    invoke-direct {p0, v5}, Lrexsee/core/browser/RexseeClient;->getVersionKey(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iget v6, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->version:I

    invoke-interface {v3, v5, v6}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 259
    invoke-interface {v3}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .end local v3    # "editor":Landroid/content/SharedPreferences$Editor;
    .end local v4    # "preference":Landroid/content/SharedPreferences;
    :cond_2
    move-object v5, v1

    .line 261
    goto :goto_0
.end method

.method public getHomepage(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    .line 221
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-virtual {p0, p1}, Lrexsee/core/browser/RexseeClient;->getRoot(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "index.html"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 30
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 26
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Client"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getJson(Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    const/4 v0, 0x1

    .line 245
    invoke-direct {p0, p1, v0, v0}, Lrexsee/core/browser/RexseeClient;->getClient_(Ljava/lang/String;ZZ)Lrexsee/core/browser/RexseeClient$ClientDescription;

    move-result-object v0

    invoke-virtual {v0}, Lrexsee/core/browser/RexseeClient$ClientDescription;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getLatestVersion(Ljava/lang/String;)I
    .locals 2
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    const/4 v1, 0x0

    .line 236
    invoke-direct {p0, p1, v1, v1}, Lrexsee/core/browser/RexseeClient;->getClient_(Ljava/lang/String;ZZ)Lrexsee/core/browser/RexseeClient$ClientDescription;

    move-result-object v0

    .line 237
    .local v0, "client":Lrexsee/core/browser/RexseeClient$ClientDescription;
    iget-object v1, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->error:Ljava/lang/String;

    if-nez v1, :cond_0

    iget v1, v0, Lrexsee/core/browser/RexseeClient$ClientDescription;->version:I

    :goto_0
    return v1

    :cond_0
    const/4 v1, -0x1

    goto :goto_0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 34
    new-instance v0, Lrexsee/core/browser/RexseeClient;

    invoke-direct {v0, p1}, Lrexsee/core/browser/RexseeClient;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public getRoot(Ljava/lang/String;)Ljava/lang/String;
    .locals 4
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    .line 218
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "file://"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mContext:Landroid/content/Context;

    invoke-direct {p0, p1}, Lrexsee/core/browser/RexseeClient;->getVersionKey(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getDir(Ljava/lang/String;I)Ljava/io/File;

    move-result-object v1

    invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getVersion(Ljava/lang/String;)I
    .locals 5
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    const/4 v4, -0x1

    .line 224
    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mContext:Landroid/content/Context;

    const-string v2, "client"

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 225
    .local v0, "preference":Landroid/content/SharedPreferences;
    if-nez v0, :cond_0

    move v1, v4

    :goto_0
    return v1

    :cond_0
    invoke-direct {p0, p1}, Lrexsee/core/browser/RexseeClient;->getVersionKey(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1, v4}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v1

    goto :goto_0
.end method

.method public getXML(Ljava/lang/String;)Ljava/lang/String;
    .locals 6
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    const/4 v4, 0x1

    .line 240
    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->interfaceList:Lrexsee/core/browser/clazz/JavascriptInterfaceList;

    new-instance v2, Ljava/lang/StringBuilder;

    iget-object v3, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "Ajax"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lrexsee/core/browser/clazz/JavascriptInterfaceList;->get(Ljava/lang/String;)Lrexsee/core/browser/clazz/JavascriptInterface;

    move-result-object v0

    check-cast v0, Lrexsee/core/transportation/RexseeAjax;

    .line 241
    .local v0, "ajax":Lrexsee/core/transportation/RexseeAjax;
    if-nez v0, :cond_0

    const-string v1, "[Exception]Ajax object is not available."

    .line 242
    :goto_0
    return-object v1

    :cond_0
    const-string v2, ""

    iget-object v1, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    invoke-virtual {v1}, Lrexsee/core/application/RexseeApplication;->getDefaultEncoding()Ljava/lang/String;

    move-result-object v3

    move-object v1, p1

    move v5, v4

    invoke-virtual/range {v0 .. v5}, Lrexsee/core/transportation/RexseeAjax;->syncSubmit(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/lang/String;

    move-result-object v1

    goto :goto_0
.end method

.method public launch(Ljava/lang/String;)V
    .locals 2
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    .line 231
    iget-object v0, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    invoke-virtual {p0, p1}, Lrexsee/core/browser/RexseeClient;->getHomepage(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lrexsee/core/application/RexseeApplication;->setDeveloperHome(Ljava/lang/String;)V

    .line 232
    iget-object v0, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    invoke-virtual {v0}, Lrexsee/core/application/RexseeApplication;->confirmRestart()V

    .line 233
    return-void
.end method

.method public load(Ljava/lang/String;)V
    .locals 2
    .param p1, "xml"    # Ljava/lang/String;

    .prologue
    .line 228
    iget-object v0, p0, Lrexsee/core/browser/RexseeClient;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->function:Lrexsee/core/browser/RexseeBrowser;

    invoke-virtual {p0, p1}, Lrexsee/core/browser/RexseeClient;->getHomepage(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lrexsee/core/browser/RexseeBrowser;->load(Ljava/lang/String;)V

    .line 229
    return-void
.end method
